package com.ghy.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
//@ConditionalOnClass(value = {PaginationInterceptor.class})
public class MybatisPlusIPageConfig {
//    @Bean
//    public PaginationInterceptor paginationInterceptor() {
//        return new PaginationInterceptor();
////        2022-7-18 于莹莹修改，当超出查询页码时，显示最后一页的数据。
////        myPaginationInnerInterceptor paginationInnerInterceptor = new myPaginationInnerInterceptor();
////        paginationInnerInterceptor.setOverflow(true);
////        return paginationInnerInterceptor;
//    }

    /**
     *   mybatis-plus分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor page = new PaginationInterceptor();
        page.setDialectType("mysql");
        return page;
    }
}

